package com.qf.controller;

import cn.dsna.util.images.ValidateCode;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/8/16 21:43
 */
@WebServlet("/code")
public class code extends BaseServlet{
    public void createCode(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ValidateCode validateCode=new ValidateCode(100,40,4,10);
        validateCode.createCode();
        String code = validateCode.getCode();
        System.out.println("code = " + code);
        request.getSession().setAttribute("pagecode", code);
        validateCode.write(response.getOutputStream());
    }
}
